package org.yenn.pattern.observer.weather5;

import lombok.Getter;
import lombok.Setter;

/**
 * @Author: yerenyun
 * @Description:
 */
@Getter
@Setter
public class ConcreteObserver implements Observer{
    // 观察者名称
    private String observerName;
    // 天气情况的内容
    private String weatherContent;
    // 提醒的内容
    private String remindThing;

    @Override
    public void update(WeatherSubject subject) {
        this.weatherContent = ((ConcreteWeatherSubject) subject).getWeatherContent();
        System.out.println(observerName+"收到了"+weatherContent+","+remindThing);
    }

    @Override
    public void setObserverName(String observerName) {
        this.observerName = observerName;
    }

    @Override
    public String getObserverName() {
        return this.observerName;
    }
}
